package com.djt.book_system.util;


public class Result {
    private int code;//状态码
    private String msg;//提示消息
    private int count;//总记录数
    private Object data;//数据

    public static Result fail(){
        Result r = new Result();
        r.code = 500;
        r.msg = "操作失败";
        r.count = 0;
        r.data = null;
        return  r;
    }

    public static Result success(int count,Object data){
        Result r = new Result();
        r.code= 0;
        r.msg="操作成功";
        r.count = count;
        r.data = data;
        return r;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
